<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"
	href="ext/resources/css/ext-all.css" />
<!-- GC -->
<!-- LIBS -->
<script type="text/javascript" src="ext/adapter/ext/ext-base.js">
	
</script>
<!-- ENDLIBS -->
<script type="text/javascript" src="ext/ext-all.js">
	
</script>

<script type="text/javascript" src="ext/ext-lang-zh_CN.js">
	
</script>
<script type="text/javascript">
	Ext.onReady(function() {

		// HtmlEditor需要这个  
		Ext.QuickTips.init();

		var form = new Ext.form.FormPanel({
			buttonAlign : 'center',
			width : 600,
			title : '增加用户',
			frame : true,
			fieldDefaults : {
				labelAlign : 'right',
				labelWidth : 70
			},
			items : [{
						xtype : 'container',
						layout : 'column',
						items : [{
							columnWidth : .7,
							xtype : 'fieldset',
							collapsible : true, //是否为可折叠  
							collapsed : false, //默认是否折叠  
							title : '用户信息',
							autoHeight : true,
							defaults : {
								width : 300
							},
							defaultType : 'textfield',
							items : [{
										fieldLabel : '姓名',
										name : 'user.name'
									},{
										fieldLabel : '住址',
										name : 'user.address'
									},{
										xtype : 'numberfield',
										fieldLabel : '电话号码',
										name : 'user.phone'
									},{
										xtype : "combo",
										fieldLabel : '用户类型',
										store : new Ext.data.SimpleStore({
											fields : [ 'value', 'text' ],
											data : [ [ 'value1', '普通用户' ],
													[ 'value2', '商业用户' ] ]
										}),
										displayField : 'text',
										valueField : 'value',
										mode : 'local',
										emptyText : '请选择'
									} ]
						} ]
					}, {
						xtype : 'container',
						layout : 'form',
						items : [ {
							labelAlign : 'top',
							xtype : 'htmleditor',
							fieldLabel : '备注',
							id : 'editor',
							name : 'user.notes',
							anchor : '98%',
							height : 200
						} ]
					} ],
			buttons : [ {
				text : '添加用户',
				addFrom.getForm().doAction('submit',{
					url : "ImportBackupConfigHistory.action?nodeId="+nodeId,
					method:'POST',
					success : function(form, action) {
					Ext.Msg.alert("服务提示",
					action.result.msg,function(){
						Ext.getCmp("listBackupFile-grid").getStore().reload();win.close();
						});
					},
					failure : function(form, action) {
					Ext.Msg.alert(
					'<font color="blue">提示</font>',
					"内部出错",function(){
						Ext.getCmp("AddSubmit").setDisabled(false);
					})
					}}
			)}] 
		});

		form.render("form");
	});
</script>
</head>
<body>

	<div id="form"></div>
</body>
</html>